from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
import uvicorn

from service import router

app = FastAPI()

origins = ['*']

if __name__ == '__main__':
    app.include_router(router)
    app.add_middleware(
        CORSMiddleware,
        allow_origins=origins,
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    ),
    uvicorn.run(app, host="127.0.0.1", port=5000, log_level="info") 